package com.itheima.dao;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @version V1.0
 * @author: yongjichu
 * @date: 2020/1/15 19:13
 * @description:
 */
public interface OrderSettingMapper {
    /**
     * 根据orderData查询数据
     * @param orderDate
     * @return
     */
    Long findCountByOrderData(@Param("orderDate") Date orderDate);

    /**
     * 根据日期跟新对应的预约人数
     * @param orderSetting
     */
    void setNumberByDate(OrderSetting orderSetting);

    /**
     * 根据数据向表中新增数据
     * @param orderSetting
     */
    void addOrderSetting(OrderSetting orderSetting);

    /**
     * 查询预约设置的数据
     * @param dateBegin
     * @param dateEnd
     * @return
     */
    List<OrderSetting> getOrderSettingByMonth(@Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd);

    /**
     * 根据日期查询有没有这个数据
     * @param orderDate
     * @return
     */
    OrderSetting findbyOrderDate(@Param("orderDate") Date orderDate);

    /**
     * 更新数据
     * @param orderSetting
     * @return
     */
    int editReservations(OrderSetting orderSetting);
}
